package com.cloud.rocketmqtxprovider.controller;

import com.cloud.rocketmqtxprovider.entity.Order;
import com.cloud.rocketmqtxprovider.service.ProviderService;
import org.apache.rocketmq.client.exception.MQClientException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
@SuppressWarnings("all")
public class MainController {

    @Autowired
    private ProviderService providerService;

    @PostMapping("/createOrder")
    public String createOrder(@RequestBody Order order)throws MQClientException {
        return providerService.insertOrder(order);
    }
    
}
